/**
 * 
 */
package br.ucb.entity;

import java.util.ArrayList;
import java.util.List;

public class NoArvore {

	
	public static final int CONCEITO=1,CONTEUDO=2;
	
	private int type;
	private Object value;
	private List<NoArvore> childs = new ArrayList<NoArvore>();
	
	public NoArvore(Object value, int type) {
		this.value = value;
		this.type = type;
	}
	
	public Object getValue() {
		return value;
	}
	public List<NoArvore> getChilds() {
		return childs;
	}
	public void addChild(NoArvore child){
		if (!childs.contains(child)) childs.add(child);
	}
	
	public boolean isConteudo(){
		return type==CONTEUDO;
	}
	public boolean isConceito(){
		return type==CONCEITO;
	}
	
	@Override
	public String toString() {
		return type+": "+value;
	}
}
